<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Faiss: faiss::gpu::FlatIndex Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Faiss
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacefaiss.html">faiss</a></li><li class="navelem"><b>gpu</b></li><li class="navelem"><a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html">FlatIndex</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classfaiss_1_1gpu_1_1FlatIndex-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">faiss::gpu::FlatIndex Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Holder of GPU resources for a particular flat index.  
 <a href="classfaiss_1_1gpu_1_1FlatIndex.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a09114f736efaadcdc0f2b51ac03909be"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a09114f736efaadcdc0f2b51ac03909be"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>FlatIndex</b> (<a class="el" href="classfaiss_1_1gpu_1_1GpuResources.html">GpuResources</a> *res, int dim, bool l2Distance, bool useFloat16, bool useFloat16Accumulator, bool storeTransposed, MemorySpace space)</td></tr>
<tr class="separator:a09114f736efaadcdc0f2b51ac03909be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8fa02481e912b0be2ad3a29b87edd85d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8fa02481e912b0be2ad3a29b87edd85d"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>getUseFloat16</b> () const </td></tr>
<tr class="separator:a8fa02481e912b0be2ad3a29b87edd85d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6988df17792dae30f24cc859728777e6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6988df17792dae30f24cc859728777e6"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html#a6988df17792dae30f24cc859728777e6">getSize</a> () const </td></tr>
<tr class="memdesc:a6988df17792dae30f24cc859728777e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of vectors we contain. <br/></td></tr>
<tr class="separator:a6988df17792dae30f24cc859728777e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a466a22d95f218b1998049943ca3134bf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a466a22d95f218b1998049943ca3134bf"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>getDim</b> () const </td></tr>
<tr class="separator:a466a22d95f218b1998049943ca3134bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a06b678b97e3732939f6a4fb5106ef6"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7a06b678b97e3732939f6a4fb5106ef6"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html#a7a06b678b97e3732939f6a4fb5106ef6">reserve</a> (size_t numVecs, cudaStream_t stream)</td></tr>
<tr class="memdesc:a7a06b678b97e3732939f6a4fb5106ef6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reserve storage that can contain at least this many vectors. <br/></td></tr>
<tr class="separator:a7a06b678b97e3732939f6a4fb5106ef6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a12058744ffb3fbcbb047872449269c06"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a12058744ffb3fbcbb047872449269c06"></a>
<a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; float, 2, true &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html#a12058744ffb3fbcbb047872449269c06">getVectorsFloat32Ref</a> ()</td></tr>
<tr class="memdesc:a12058744ffb3fbcbb047872449269c06"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a reference to our vectors currently in use. <br/></td></tr>
<tr class="separator:a12058744ffb3fbcbb047872449269c06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a258b0dd61a9c352ec7d68fa8bac0d7ad"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classfaiss_1_1gpu_1_1DeviceTensor.html">DeviceTensor</a>&lt; float, 2, true &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html#a258b0dd61a9c352ec7d68fa8bac0d7ad">getVectorsFloat32Copy</a> (cudaStream_t stream)</td></tr>
<tr class="separator:a258b0dd61a9c352ec7d68fa8bac0d7ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6057667e09193d786c25d90355d28838"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6057667e09193d786c25d90355d28838"></a>
<a class="el" href="classfaiss_1_1gpu_1_1DeviceTensor.html">DeviceTensor</a>&lt; float, 2, true &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html#a6057667e09193d786c25d90355d28838">getVectorsFloat32Copy</a> (int from, int num, cudaStream_t stream)</td></tr>
<tr class="memdesc:a6057667e09193d786c25d90355d28838"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns only a subset of the vectors. <br/></td></tr>
<tr class="separator:a6057667e09193d786c25d90355d28838"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25facbf9a1a5f463fc8e4131df8da552"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a25facbf9a1a5f463fc8e4131df8da552"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>query</b> (<a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; float, 2, true &gt; &amp;vecs, int k, <a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; float, 2, true &gt; &amp;outDistances, <a class="el" href="classfaiss_1_1gpu_1_1Tensor.html">Tensor</a>&lt; int, 2, true &gt; &amp;outIndices, bool exactDistance)</td></tr>
<tr class="separator:a25facbf9a1a5f463fc8e4131df8da552"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab91c9ddf7dd258620f424619cb029e22"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html#ab91c9ddf7dd258620f424619cb029e22">add</a> (const float *data, int numVecs, cudaStream_t stream)</td></tr>
<tr class="separator:ab91c9ddf7dd258620f424619cb029e22"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae06cb2ffd46659b6639b97297546096e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae06cb2ffd46659b6639b97297546096e"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfaiss_1_1gpu_1_1FlatIndex.html#ae06cb2ffd46659b6639b97297546096e">reset</a> ()</td></tr>
<tr class="memdesc:ae06cb2ffd46659b6639b97297546096e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free all storage. <br/></td></tr>
<tr class="separator:ae06cb2ffd46659b6639b97297546096e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Holder of GPU resources for a particular flat index. </p>

<p>Definition at line <a class="el" href="FlatIndex_8cuh_source.html#l00021">21</a> of file <a class="el" href="FlatIndex_8cuh_source.html">FlatIndex.cuh</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ab91c9ddf7dd258620f424619cb029e22"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void faiss::gpu::FlatIndex::add </td>
          <td>(</td>
          <td class="paramtype">const float *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>numVecs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">cudaStream_t&#160;</td>
          <td class="paramname"><em>stream</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Add vectors to ourselves; the pointer passed can be on the host or the device </p>

<p>Definition at line <a class="el" href="FlatIndex_8cu_source.html#l00196">196</a> of file <a class="el" href="FlatIndex_8cu_source.html">FlatIndex.cu</a>.</p>

</div>
</div>
<a class="anchor" id="a258b0dd61a9c352ec7d68fa8bac0d7ad"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classfaiss_1_1gpu_1_1DeviceTensor.html">DeviceTensor</a>&lt; float, 2, true &gt; faiss::gpu::FlatIndex::getVectorsFloat32Copy </td>
          <td>(</td>
          <td class="paramtype">cudaStream_t&#160;</td>
          <td class="paramname"><em>stream</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Performs a copy of the vectors on the given device, converting as needed from float16 </p>

<p>Definition at line <a class="el" href="FlatIndex_8cu_source.html#l00089">89</a> of file <a class="el" href="FlatIndex_8cu_source.html">FlatIndex.cu</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/data/users/hoss/faiss/gpu/impl/<a class="el" href="FlatIndex_8cuh_source.html">FlatIndex.cuh</a></li>
<li>/data/users/hoss/faiss/gpu/impl/<a class="el" href="FlatIndex_8cu_source.html">FlatIndex.cu</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
